package com.itheima.d4_printstream;

import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.nio.charset.Charset;

public class PrintTest2 {
    public static void main(String[] args) {

        try (    PrintStream ps = new PrintStream("D:\\Java\\JavaEE_learn\\IO_app2\\src\\itheima09.txt");)
        {
            System.setOut(ps);
            System.out.println("1111");
            System.out.println("2222");
            System.out.println("3333");
            System.out.println("4444");
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }

    }
}
